package org
{
	import mx.collections.ArrayCollection;
	
	public class CacheUtils
	{
		public static var _panelList:ArrayCollection = new ArrayCollection();
		public static var _cPos:int = 0;
		public static var _cCount:int = 0;
		public function CacheUtils()
		{
		}
		public static function push(p_panel:Object):void{	
			if(!_panelList.contains(p_panel)){
				_panelList.addItem(p_panel);
				_cPos++;
				_cCount++;
			}
		}
		public static function getPrePanel():Object{
			_cPos--;
			if(_cPos<0){
				_cPos=0;
				return null;
			}
			return _panelList.getItemAt(_cPos);
		}
		public static function getNextPanel():Object{
			_cPos++;
			if(_cPos>_cCount){
				_cPos = _cCount;
				return null;
			}
			return _panelList.getItemAt(_cPos-1);
		}
	}
}